﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

using AtletIS.DomainModel.ObjectState;
using AtletIS.Repository.Repositories;

namespace AtletIS.Repository.UnitOfWork
{
    public interface IUnitOfWork : IDisposable
    {
        int SaveChanges();
        void Dispose(bool disposing);

        IRepository<TEntity> Repository<TEntity>() where TEntity : IObjectState;
        IEnumerable<TResult> ExecuteQuery<TResult>(string query, params object[] parameters);
        DataTable ExecuteQueryToTable(SqlCommand sqlCommand);
        
        void BeginTransaction();
        bool Commit();
        void Rollback();
    }
}
